{% extends "base.twig" %}

{% block title %}list{% endblock %}
{% block head %}
    {{ parent() }}
    <style type="text/css">
        .important { color: #336699; }
    </style>
{% endblock %}
{% block content %}

        <div class="header">
            <h1>{{title}}</h1>
            <h2>{{msg}}</h2>
        </div>

        <div class="content">
            
			<table class="pure-table">
			    <thead>
			        <tr>
			            <th>#</th>
			            <th>病种</th>
			            <th>疗法</th>
			            <th>图</th>
			        </tr>
			    </thead>

			    <tbody>
			{% for disease in diseases %}
					<tr>
			            <td><a class="button-secondary pure-button button-small" href="/disease/edit/{{disease.id}}">{{disease.id}}</a></td>
			            <td>{{disease.name}}</td>
			            <td>{{disease.treatment}}</td>
			            <td>{% if disease.picture %}<img class="pure-img" src="/{{disease.picture}}">{% endif %}</td>
			        </tr>
			{% endfor %}
			        
			    </tbody>
			</table>


			<div class="pure-g">
			    <div class="pure-u-1 pure-u-md-1-2">
					<ul class="pagination">
						{% for i in 1..pagination['pages'] %}					
							<a {% if i!=pagination['current'] %}href="?p={{i}}"{% endif %} class="pure-button{% if i==pagination['current'] %} pure-button-disabled{% endif %}">{{i}}</a>
						{% endfor %}
					</ul>
				</div>
			    <div class="pure-u-1 pure-u-md-1-2"><p class="pagination-info"><span class="pure-button">共<i>{{pagination['counts']}}</i>条,<i>{{pagination['pages']}}</i>页,每页<i>{{pagination['per']}}</i>条</span></p></div>
			</div>

			

        </div>

{% endblock %}